package com.hinotoyk.testsystem.service;

import com.hinotoyk.testsystem.entity.Admin;
import com.hinotoyk.testsystem.entity.AdminExample;
import com.hinotoyk.testsystem.entity.TestPaperInfo;
import com.hinotoyk.testsystem.mappers.AdminMapper;
import com.hinotoyk.testsystem.mappers.TestPaperInfoMapper;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: testsystem
 * @description:
 * @author: DYJ
 * @create: 2019-11-14 14:29
 **/

@Service
public class AdminService {
    @Resource
    private AdminMapper adminMapper;

    public Admin getAdmin(String username) {
        AdminExample adminExample = new AdminExample();
        adminExample.createCriteria().andAdminNameEqualTo(username);
        List<Admin> admins = adminMapper.selectByExample(adminExample);
        return admins.get(0);
    }
}
    